/*
 * testScenarioScrollBar.h
 *
 *  Created on: Oct 3, 2011
 *      Author: nicoabie
 */

#ifndef TESTSCENARIOSCROLLBAR_H_
#define TESTSCENARIOSCROLLBAR_H_

#include "../src/common/utils/Logger.h"

#include "../src/SDLtoolkit/widgets/ScenarioScrollBar.h"

void testScenarioScrollBar() {

	SDLEngine* engine = new SDLEngine("prueba scenario scroll bar", 800, 600,
			24);

	engine->start();

	ScenarioElement* drag = NULL;
	ScenarioScrollBar* scroll = new ScenarioScrollBar(0, 0,
			engine->getMainSurface(), &drag);

	Event* eventoloco = new Event();

	bool quit = false;
	while (quit == false) {
		while (engine->pullEvent(eventoloco)) {
			scroll->handleEvent(*eventoloco);

			if (drag != NULL) {
				Logger::log("", "", "Lo agarraste amigo");
			}

			engine->refreshScreen();

			if (eventoloco->getType() == Quit) {
				quit = true;
			}
		}
	}

	engine->stop();

	Logger::log("Tests", "scenario scroll bar", "Finalizado.");
}

#endif /* TESTSCENARIOSCROLLBAR_H_ */
